#define _CRT_SECURE_NO_WARNINGS 1

#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

bool IsGoodNum(ll n)
{
	int pos = 1;
	while (n > 0)
	{
		if ((pos % 2 == 1 && (n % 10) % 2 == 0) || (pos % 2 == 0 && (n % 10) % 2 == 1))
			return false;
		n /= 10;
		pos++;
	}
	return true;
}

int main()
{
	ll N;
	cin >> N;
	ll cnt = 0;
	for (int i = 1; i <= N; i++)
	{
		if (IsGoodNum(i))
			cnt++;
	}

	cout << cnt << endl;

	return 0;
}